Skip to content

[Don't Merge] Replace the deprecated pkg_resources API [RHELDST-33715] - #673

Closed
dichn wants to merge 1 commit into
release-engineering:masterfrom
dichn:pkg
Closed

[Don't Merge] Replace the deprecated pkg_resources API [RHELDST-33715]#673
dichn wants to merge 1 commit into
release-engineering:masterfrom
dichn:pkg

Conversation

@dichn

@dichn dichn commented Sep 5, 2025

Copy link
Copy Markdown

pkg_resources is deprecated as an API. Updated Source.__load_entrypoints to use importlib.metadata.entry_points, removing the need for pkg_resources.

🚫 Don't merge this until the primary python version bumping to 3.10+
This issue is to fix a deprecation warning

../../dev/python3.11/lib64/python3.11/site-packages/pushsource/_impl/source.py:8
  /home/dichen/dev/python3.11/lib64/python3.11/site-packages/pushsource/_impl/source.py:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources 

But the alternative solution importlib.metadata was added only in Python 3.8, and its behavior differs between Python 3.8–3.9 and Python 3.10+.

# Python 3.10+: entry_points(group=...)
eps = entry_points(group="pushsource")
# Python 3.8–3.9: entry_points() returns dict-like
eps = entry_points().get("pushsource", [])

In order to make the replacement clean, let's include this change after the primary python version bumping to 3.10+.

pkg_resources is deprecated as an API. Updated Source.__load_entrypoints
to use importlib.metadata.entry_points, removing the need for pkg_resources.
@dichn dichn self-assigned this Sep 5, 2025
@dichn
dichn marked this pull request as draft September 5, 2025 07:33
@dichn

dichn commented Sep 5, 2025

Copy link
Copy Markdown
Author

Close this PR due to lacking backwards compatibility. It can be re-opened if necessary.

@dichn dichn closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant